package nju.bean.meeting.transporter.Request;


import junit.framework.Assert;
import nju.bean.meeting.data.Meeting;
import nju.bean.meeting.meetingManagement.MeetingManager;
import nju.bean.meeting.transporter.Feedback.JudgeFeedback;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class RedoRequestTest{

	private RedoRequest first;
	private RedoRequest second;
	
	@Before
	public void setUp() throws Exception {
		first = new RedoRequest("wy");
		second = new RedoRequest("gsw");
		int ports[] = {9999,9998,9997};
		Meeting meeting = new Meeting(6);
		MeetingManager mm = new MeetingManager(meeting,ports);
		first.setManager(mm);
		second.setManager(mm);
	}

	@After
	public void tearDown() throws Exception {
	}
	
	@Test
	public void TestDeal(){
		JudgeFeedback result1 = (JudgeFeedback)first.deal();
		JudgeFeedback result2 = (JudgeFeedback)second.deal();
		boolean bool1 = result1.getResult();
		boolean bool2 = result2.getResult();
		Assert.assertEquals(bool1, true);
		Assert.assertEquals(bool2, false);
		JudgeFeedback result3 = (JudgeFeedback)first.deal();
		JudgeFeedback result4 = (JudgeFeedback)first.deal();
		boolean bool3 = result3.getResult();
		boolean bool4 = result4.getResult();
		Assert.assertEquals(bool3, true);
		Assert.assertEquals(bool4, true);
	}

}
